﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib  prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="ctx" value="${pageContext.request.contextPath }"/>
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
	<meta charset="utf-8" />
	<title>固定资产管理系统</title>
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta content="width=device-width, initial-scale=1.0" name="viewport" />
	<meta content="" name="description" />
	<meta content="" name="author" />
	<meta name="MobileOptimized" content="320">
	<!-- BEGIN GLOBAL MANDATORY STYLES -->
	<link href="${ctx}/assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css"/>
	<!-- END GLOBAL MANDATORY STYLES -->	
	<!-- BEGIN THEME STYLES --> 
	<link href="${ctx}/assets/css/style-metronic.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/style.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/style-responsive.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/plugins.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/pages/tasks.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/themes/light.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/css/custom.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/css/custom.css" rel="stylesheet" type="text/css"/>

	<link rel="stylesheet" type="text/css" href="${ctx}/assets/plugins/select2/select2_metro.css" />
	<link rel="stylesheet" href="${ctx}/assets/plugins/data-tables/DT_bootstrap.css" />
	
	<link href="${ctx}/assets/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css" rel="stylesheet" type="text/css"/>
	<link href="${ctx}/assets/plugins/bootstrap-modal/css/bootstrap-modal.css" rel="stylesheet" type="text/css"/>
	<!-- END THEME STYLES -->
	<link rel="shortcut icon" href="favicon.ico" />
	<style type="text/css">
		.page-content{
			min-height:900px;
		}
	</style>
</head>
<body class="page-header-fixed">
	<!-- BEGIN HEADER -->
	<%@include file="../include/header.jsp" %>
	<!-- END HEADER -->
	<div class="clearfix"></div>
	<!-- BEGIN CONTAINER -->
	<div class="page-container">
		<!-- BEGIN SIDEBAR -->
		<%@include file="../include/sidebar.jsp" %>
		<!-- END SIDEBAR -->
		<!-- BEGIN PAGE -->
		<div class="page-content">			
			<div class="row">
				<div class="col-md-12">
					<!-- BEGIN PAGE TITLE & BREADCRUMB-->
					<h3 class="page-title">
						资产报废流程
					</h3>
					
					<!-- END PAGE TITLE & BREADCRUMB-->
				</div>
			</div>
			<!-- END PAGE HEADER-->
			<!-- BEGIN PAGE CONTENT-->
			<div class="row">
				<div class="col-md-12">
					<!-- BEGIN TAB PORTLET-->   
					<div class="portlet box green tabbable">
						<div class="portlet-title">
							<div class="caption"><i class="fa fa-reorder"></i>资产报废待办</div>
						</div>
						<div class="portlet-body">
							<div class=" portlet-tabs">
								<ul class="nav nav-tabs">
								    <c:if test="${!empty bfxgbmspList}"><li><a href="#portlet_tab0" data-toggle="tab" id="bfxgbmspTab">报废相关部门审批</a></li></c:if>
                                    <c:if test="${!empty baoFeiBMList}"><li><a href="#portlet_tab1" data-toggle="tab" id="bmspTab">部门审批</a></li></c:if>
                                    <c:if test="${!empty baoFeiGKBMList}"><li><a href="#portlet_tab2" data-toggle="tab" id="gkbmspTab">归口部门审批</a></li></c:if>
                                    <c:if test="${!empty baoFeiChuLiCW}"><li><a href="#portlet_tab4" data-toggle="tab">报废处理入账</a></li></c:if>
                                    <c:if test="${!empty baofeiWCList}"><li><a href="#portlet_tab5" data-toggle="tab" id="bfclqrTab">报废处理确认</a></li></c:if>
                                    <c:if test="${!empty fqtbbfList}"><li><a href="#portlet_tab11" data-toggle="tab" id="fqtbbfListTab">发起填报报废</a></li></c:if>
								</ul>
								<div class="tab-content">
								    <div class="tab-pane <c:if test="${active==5}">active</c:if>" id="portlet_tab1">
                                        <div class="portlet-body">
                                            <form method="POST" id="bmbaoFeiForm">
                                                <div style="text-align:right;">
                                                    <a class="btn blue" id="bmPiSubmit"><i class="fa fa-search"></i>&nbsp;&nbsp;批量同意</a>&nbsp;&nbsp;
                                                    <a class="btn red" id="bmspBHPL"><i class="fa fa-search"></i>&nbsp;&nbsp;批量驳回</a>
                                                </div>
                                                <div class="table-scrollable">
                                                    <table class="table table-striped table-bordered table-hover" id="sample_1">
                                                        <thead>
                                                            <tr>
                                                                <th><input type="checkbox" id="bmSelectAll"></th>
                                                                <th>申请日期</th>
                                                                <th>资产编号</th>
                                                                <th>物资名称</th>
                                                                <th>产品序列号</th>
                                                                <th>报废类型</th>
                                                                <th>报废原因</th>
                                                                <th>查看</th>
                                                                <th>操作</th>
                                                            </tr>
                                                        </thead>
                                                        <tbody id="bmsp">
                                                        </tbody>
                                                    </table>
                                                </div>
                                            </form>
                                        </div>
                                    </div>
                                    <div class="tab-pane" id="portlet_tab2">
                                        <div class="portlet-body">
                                            <form method="POST" id="gkbmbaoFeiForm">
                                                <div style="text-align:right;">
                                                    <a class="btn blue" id="gkbmPiSubmit"><i class="fa fa-search"></i>&nbsp;&nbsp;批量同意</a>&nbsp;&nbsp;
                                                    <a class="btn red" id="gkbmspBHPL"><i class="fa fa-search"></i>&nbsp;&nbsp;批量驳回</a>
                                                </div>
                                                <div class="table-scrollable">
                                                    <table class="table table-striped table-bordered table-hover" id="sample_1">
                                                        <thead>
                                                            <tr>
                                                                <th><input type="checkbox" id="gkbmSelectAll"></th>
                                                                <th>申请日期</th>
                                                                <th>资产编号</th>
                                                                <th>物资名称</th>
                                                                <th>产品序列号</th>
                                                                <th>报废类型</th>
                                                                <th>报废原因</th>
                                                                <th>查看</th>
                                                                <th>操作</th>
                                                            </tr>
                                                        </thead>
                                                        <tbody id="gkbmsp">
                                                        </tbody>
                                                    </table>
                                                </div>
                                            </form>
                                        </div>
                                    </div>

									<div class="tab-pane <c:if test="${active==4}">active</c:if>" id="portlet_tab0">
										<div class="portlet-body">
											<form method="POST" id="baoFeiHQForm">
												<div style="text-align:right;">
													<a class="btn blue" id="bfhqPiSubmit"><i class="fa fa-search"></i>&nbsp;&nbsp;批量同意</a>
													<a class="btn red" id="bfhqBHPL"><i class="fa fa-edit"></i>&nbsp;&nbsp;批量驳回</a>
												</div>
												<div class="table-scrollable">
													<table class="table table-striped table-bordered table-hover" id="sample_1">
														<thead>
															<tr>
																<th><input type="checkbox" id="bfhqSelectAll"></th>	
																<th>资产编号</th>
																<th>物资名称</th>
																<th>品牌</th>
																<th>规格型号</th>
																<th>产品序列号</th>
																<th>报废类型</th>
																<th>报废原因</th>
																<th>查看</th>																	
																<th>操作</th>
															</tr>
														</thead>
														<tbody id="bfhq">
														</tbody>
													</table>
												</div>
											</form>
										</div>
									</div>

									<div class="tab-pane" id="portlet_tab11">
										<div class="portlet-body">
											<form method="POST" id="fqhqForm">
												<div style="text-align:right;">
													<a class="btn blue" id="fqhqPL"><i class="fa fa-search"></i>&nbsp;&nbsp;批量发起</a>
												</div>
												<div class="table-scrollable">
													<table class="table table-striped table-bordered table-hover" id="sample_1">
														<thead>
															<tr>
																<th><input type="checkbox" id="fqhqAll"></th>	
																<th>资产编号</th>
																<th>物资名称</th>
																<th>品牌</th>
																<th>规格型号</th>
																<th>产品序列号</th>
																<th>报废类型</th>
																<th>报废原因</th>
																<th>查看</th>																	
																<th>操作</th>
															</tr>
														</thead>
														<tbody id="fqhq">
														</tbody>
													</table>
												</div>
											</form>
										</div>
									</div>


									<div class="tab-pane <c:if test="${active==9}">active</c:if>" id="portlet_tab4">
										<div class="portlet-body">
											<div class="table-scrollable">
												<table class="table table-striped table-bordered table-hover" id="sample_1">
													<thead>
														<tr>														
															<th>资产编码</th>
															<th>物资名称</th>
															<th>品牌</th>
															<th>规格型号</th>
															<th>产品序列号</th>														
															<th>处理方式</th>
															<th>回收金额</th>
															<th>查看</th>															
															<th>操作</th>
														</tr>
													</thead>
													<tbody id="bfclrz">
														<c:forEach items="${baoFeiChuLiCW }" var="u">													
														<tr>														
															<td>${u.wuZi.ziChanBM }</td>
															<td>${u.wuZi.wuZiMC }</td>
															<td>${u.wuZi.pinPai }</td>
															<td>${u.wuZi.guiGeXH }</td>
															<td>${u.wuZi.chanPinXLH }</td>
															<td>${u.chuLiFS }</td>
															<td>${u.huiShouJE }</td>
															<td>
																<a href="${ctx }/wuzi/wuZiDetail.do?id=${u.wuZi.id}" target="_blank" class="btn default btn-xs green-stripe">物资详情</a>&nbsp;&nbsp;
																<a href="${ctx }/wuzi/baoFeiDetail.do?id=${u.id}" target="_blank" class="btn default btn-xs green-stripe">流程详情</a>
															</td>
															<td>
																<a href="javascript:baoFeiRZ('${u.id}', '${u.huanJie.id}');" class="btn default btn-xs green-stripe">确认</a>&nbsp;&nbsp;
																<%--<a href="${ctx }/wuzi/chuLiBTY.do?id=${u.id}" target="_blank" class="btn default btn-xs green-stripe">返回修改</a>															--%>
															</td>
														</tr>
														</c:forEach>													
													</tbody>
												</table>
											</div>
										</div>
									</div>
									<div class="tab-pane <c:if test="${active==10}">active</c:if>" id="portlet_tab5">
										<div class="portlet-body">
											<form method="POST" id="bfclqrForm">
												<div style="text-align:right;">
													<a class="btn green" id="bfclqrPLDY"><i class="fa fa-search"></i>&nbsp;&nbsp;批量打印</a>&nbsp;&nbsp;
													<a class="btn blue" id="bfclqrPiSubmit"><i class="fa fa-search"></i>&nbsp;&nbsp;批量确认</a>
												</div>
												<div class="table-scrollable">
													<table class="table table-striped table-bordered table-hover" id="sample_1">
														<thead>
															<tr>
																<th><input type="checkbox" id="bfclqrSelectAll"></th>
																<th>资产编号</th>
																<th>物资名称</th>
																<th>品牌</th>
																<th>规格型号</th>
																<th>产品序列号</th>														
																<th>处理方式</th>
																<th>回收金额</th>
																<th>查看</th>															
																<th>操作</th>
															</tr>
														</thead>
														<tbody id="bfclqr">
														</tbody>
													</table>
												</div>
											</form>
										</div>
									</div>
								</div>								
							</div>
						</div>
					</div>					
				</div>
			</div>
			<!-- END PAGE CONTAINER-->			
		</div>
		<!-- END PAGE -->
	</div>
	<!-- END CONTAINER -->
	<div id="div3" style="display:none">  
	  <table width="100%" border="0">	  
	  <tr>
	    <td colspan="4" align="center"><strong>物资报废处理单</strong></td>
	  </tr>
	  <tr>
	    <td width="25%" align="left"></td>
	    <td colspan="2" align="center" id="cLdanJuRQ"></td>
	    <td width="25%" align="center">字第&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号</td>
	  </tr>
	</table>
	</div>
	<div id="div4" style="display:none">
	<table width="100%" border="1" align="center" cellspacing="1" >
	  <tr>
	    <th width="25%">物资编号</th>
	    <td width="25%" id="cLziChanBH"></td>
	    <th width="25%">资产编码</th>
	    <td width="25%" id="cLziChanBM"></td>	    
	  </tr>
	  <tr>
	    <th width="25%">物资名称</th>
	    <td width="25%" id="cLwuZiMC"></td>
	    <th width="25%">购买日期</th>
	    <td width="25%" id="cLgouMaiRQ"></td>
	  </tr>
	  <tr>
	    <th width="25%">开始计提日期</th>
	    <td width="25%" id="cLkaiShiJiTiRQ"></td>
	    <th width="25%">物资原值</th>
	    <td width="25%" id="cLwuZiYZ"></td>
	  </tr>
	  <tr>
	    <%--<th width="25%">物资净值</th>
	    <td width="25%" id="cLwuZiJingZhi"></td>--%>
	    <th width="25%">累计折旧金额</th>
	    <td width="25%" id="cLleiJiZheJiuJE"></td>
	  </tr>
	  <%--<tr>
	  	<th width="25%">折旧月限</th>
	    <td width="25%" id="cLzheJiuYX"></td>
	    <th width="25%">已折旧月数</th>
	    <td width="25%" id="cLyiZheJiuYS"></td>
	    
	  </tr>--%>
	  <tr>
	    <th width="25%">使用部门</th>
	    <td width="25%" id="cLshiYongBM"></td>
	    <th width="25%">使用人</th>
	    <td width="25%" id="cLshiYongR"></td>
	  </tr>
	  <tr>
	    <th width="25%">处理方式</th>
	    <td width="25%" id="cLchuLiFS"></td>
	    <th width="25%">回收金额</th>
	    <td width="25%" id="cLhuiShouJE"></td>
	  </tr>
	  <tr>
	    <th>回收单位</th>
	    <td colspan="3" id="cLhuiShouDW"></td>	    
	  </tr>
	  <tr>
	    <th>财务处理人</th>
	    <td colspan="3" id="cLcaiWuQRR"></td>	    
	  </tr>
	  <tr>
	    <th rowspan="2">签字</th>
	    <td colspan="3" rowspan="2"><br><br><br></td>	    
	  </tr>
	</table>
	</div>
	<object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0> 
		<embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0 pluginspage="install_lodop32.exe"></embed>
	</object>
	<!-- BEGIN FOOTER -->
	<%@include file="../include/footer.jsp" %>
	<!-- END FOOTER -->
	<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
	<!-- BEGIN CORE PLUGINS -->   
	<!--[if lt IE 9]>
	<script src="${ctx}/assets/plugins/respond.min.js"></script>
	<script src="${ctx}/assets/plugins/excanvas.min.js"></script> 
	<![endif]-->   
	<script src="${ctx}/assets/plugins/jquery-1.10.2.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>   
	<!-- IMPORTANT! Load jquery-ui-1.10.3.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
	<script src="${ctx}/assets/plugins/jquery-ui/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/bootstrap-hover-dropdown/twitter-bootstrap-hover-dropdown.min.js" type="text/javascript" ></script>
	<script src="${ctx}/assets/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/jquery.blockui.min.js" type="text/javascript"></script>  
	<script src="${ctx}/assets/plugins/jquery.cookie.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/uniform/jquery.uniform.min.js" type="text/javascript" ></script>
	<!-- END CORE PLUGINS -->
	
	<!-- IMPORTANT! fullcalendar depends on jquery-ui-1.10.3.custom.min.js for drag & drop support -->
	<script src="${ctx}/assets/plugins/fullcalendar/fullcalendar/fullcalendar.min.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/jquery-easy-pie-chart/jquery.easy-pie-chart.js" type="text/javascript"></script>
	<script src="${ctx}/assets/plugins/jquery.sparkline.min.js" type="text/javascript"></script>  
	<!-- END PAGE LEVEL PLUGINS -->
	<!-- BEGIN PAGE LEVEL SCRIPTS -->
	<script src="${ctx}/assets/scripts/app.js" type="text/javascript"></script>
	<script src="${ctx}/assets/scripts/index.js" type="text/javascript"></script>
	<script src="${ctx}/assets/scripts/tasks.js" type="text/javascript"></script>

	<script type="text/javascript" src="${ctx}/assets/plugins/select2/select2.min.js"></script>
	<script src="${ctx}/assets/plugins/bootstrap-modal/js/bootstrap-modalmanager.js" type="text/javascript" ></script>
	<script src="${ctx}/assets/plugins/bootstrap-modal/js/bootstrap-modal.js" type="text/javascript" ></script>
	<script src="${ctx}/assets/scripts/table-advanced.js?t=202004022058"></script>
	<script type="text/javascript" src="${ctx }/lodop/LodopFuncs.js"></script>        
	<!-- END PAGE LEVEL SCRIPTS -->
	<script>
		jQuery(document).ready(function() {
		   App.init(); // initlayout and core plugins
		   $('#A').addClass("active");
		   $('#A5').addClass('active');
		   TableAdvanced.init();

		   $('#bfclqrTab').click(function(){
				$.ajax({
					type:"POST",
					url:"${ctx}/wuzi/bfclqrList.do",
					dataType:"html",
					async:false,
					success:function(data){
						$("#bfclqr").html(data);
					}
				});
		   });

		  // 显示发起填报报废列表
        $('#fqtbbfListTab').click(function(){
            $.ajax({
                type:"POST",
                url:"${ctx}/wuzi/baofeidan/fqtbbfList.do",
                dataType:"html",
                async:false,
                success:function(data){
                    $("#fqhq").html(data);
                }
            });
        });

	// 显示报废相关部门审批列表
        $('#bfxgbmspTab').click(function(){
            $.ajax({
                type:"POST",
                url:"${ctx}/wuzi/baofeidan/bfxgbmspList.do",
                dataType:"html",
                async:false,
                success:function(data){
                    $("#bfhq").html(data);
                }
            });
        });

        // 显示报废使用人确认列表
        $('#bfsyrqrTab').click(function(){
            $.ajax({
                type:"POST",
                url:"${ctx}/wuzi/baofeidan/bfsyrqrList.do",
                dataType:"html",
                async:false,
                success:function(data){
                    $("#bfclqr").html(data);
                }
            });
        });

        // 显示报废分管领导审批列表
        $('#bffgldspTab').click(function(){
            $.ajax({
                type:"POST",
                url:"${ctx}/wuzi/baofeidan/bffgldspList.do",
                dataType:"html",
                async:false,
                success:function(data){
                    $("#bfhq").html(data);
                }
            });
        });

        // 显示报废总经理审批列表
        $('#bfzjlspTab').click(function(){
            $.ajax({
                type:"POST",
                url:"${ctx}/wuzi/baofeidan/bfzjlspList.do",
                dataType:"html",
                async:false,
                success:function(data){
                    $("#bfhq").html(data);
                }
            });
        });

        // 显示报废董事长审批列表
        $('#bfdszspTab').click(function(){
            $.ajax({
                type:"POST",
                url:"${ctx}/wuzi/baofeidan/bfdszspList.do",
                dataType:"html",
                async:false,
                success:function(data){
                    $("#bfhq").html(data);
                }
            });
        });

		$('#gzglyspTab').click(function(){
			$.ajax({
				type:"POST",
				url:"${ctx}/wuzi/gzglyspList.do",
				dataType:"html",
				async:false,
				success:function(data){
					$("#gzglysp").html(data);
				}
			});
		});

		$('#bmspTab').click(function(){
			$.ajax({
				type:"POST",
				url:"${ctx}/wuzi/bmspList.do",
				dataType:"html",
				async:false,
				success:function(data){
					$("#bmsp").html(data);
				}
			});
		});

		$('#gkbmspTab').click(function(){
            $.ajax({
                type:"POST",
                url:"${ctx}/wuzi/gkbmspList.do",
                dataType:"html",
                async:false,
                success:function(data){
                    $("#gkbmsp").html(data);
                }
            });
        });


		$('#bfhqTab').click(function(){
			$.ajax({
				type:"POST",
				url:"${ctx}/wuzi/bfhqList.do",
				dataType:"html",
				async:false,
				success:function(data){
					$("#bfhq").html(data);
				}
			});
		});

		$('#bfclqrPLDY').click(function(){
			$.ajax({
				type:"POST",
				data:$('#bfclqrForm').serialize(),
				url:"${ctx}/wuzi/bfclqrPLDY.do",
				dataType:"json",
				async:false,
				success:function(data){
					if(data.result=="none"){
						alert("未选择打印内容！");
					}else{
						var bfclqrIds=data.result;
						var bfclqrId=bfclqrIds.split(",");
						LODOP=getLodop();
						LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_预览打印表格");
						LODOP.SET_PRINT_PAGESIZE (2, 0, 0,"A4");
						for(var i=0;i<bfclqrId.length;i++){
							$.ajax({
								type:"POST",
								data:{
									"id":bfclqrId[i]
								},
								url:"${ctx}/wuzi/baoFeiDaYinHTML.do",
								dataType:"html",
								async:false,
								success:function(data){
									LODOP.ADD_PRINT_HTM("10mm","30mm","250mm","400mm",data);
									LODOP.NewPage();
								}
							});
						}
						LODOP.PREVIEW();
					}
				}
			});
		});

            $('#bmSelectAll').click(function(){
                if($('#bmSelectAll').attr("checked")){
                    $("input[name='bmbfId']:checkbox").prop("checked",true);
                }else{
                    $("input[name='bmbfId']:checkbox").prop("checked",false);
                }
            });

            $('#gkbmSelectAll').click(function(){
                if($('#gkbmSelectAll').attr("checked")){
                    $("#gkbmbaoFeiForm input[name='bmbfId']:checkbox").prop("checked",true);
                }else{
                    $("#gkbmbaoFeiForm input[name='bmbfId']:checkbox").prop("checked",false);
                }
            });

            $('#gzSelectAll').click(function(){
                if($('#gzSelectAll').attr("checked")){
                    $("input[name='gzbfId']:checkbox").prop("checked",true);
                }else{
                    $("input[name='gzbfId']:checkbox").prop("checked",false);
                }
            });

            $('#bfhqSelectAll').click(function(){
                if($('#bfhqSelectAll').attr("checked")){
                    $("input[name='bfhqId']:checkbox").prop("checked",true);
                }else{
                    $("input[name='bfhqId']:checkbox").prop("checked",false);
                }
            });

            $('#bfclqrSelectAll').click(function(){
                if($('#bfclqrSelectAll').attr("checked")){
                    $("input[name='bfclqrId']:checkbox").prop("checked",true);
                }else{
                    $("input[name='bfclqrId']:checkbox").prop("checked",false);
                }
            });

            $('#gzglyPiSubmit').click(function(){
                $.ajax({
                    type:"POST",
                    data:$('#gzglybaoFeiForm').serialize(),
                    url:"${ctx}/wuzi/gzglyPiSubmit.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容!");
                        }else{
                            $.ajax({
                                type:"POST",
                                url:"${ctx}/wuzi/gzglyspList.do",
                                dataType:"html",
                                success:function(data){
                                    $("#gzglysp").html(data);
                                }
                            });
                        }
                    }
                });
            });

            $('#bmPiSubmit').click(function(){
                $.ajax({
                    type:"POST",
                    data:$('#bmbaoFeiForm').serialize(),
                    url:"${ctx}/wuzi/bmPiSubmit.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容!");
                        }else{
                            $.ajax({
                                type:"POST",
                                url:"${ctx}/wuzi/bmspList.do",
                                dataType:"html",
                                success:function(data){
                                    $("#bmsp").html(data);
                                }
                            });
                        }
                    }
                });
            });

            $('#gkbmPiSubmit').click(function(){
                $.ajax({
                    type:"POST",
                    data:$('#gkbmbaoFeiForm').serialize(),
                    url:"${ctx}/wuzi/baofeidan/gkbmPiSubmit.do",
                    dataType:"json",
                    async:false,
                    success:function(result){
                        if(result.success == true){
                            $.ajax({
                                type:"POST",
                                url:"${ctx}/wuzi/gkbmspList.do",
                                dataType:"html",
                                success:function(data){
                                    $("#gkbmsp").html(data);
                                }
                            });
                        } else {
                            alert(result.message);
                        }
                    }
                });
            });

            $('#bfhqPiSubmit').click(function(){
                $.ajax({
                    type:"POST",
                    data:$('#baoFeiHQForm').serialize(),
                    url:"${ctx}/wuzi/bfhqPiSubmit.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容");
                        }else{
                            $.ajax({
                                type:"POST",
                                url:"${ctx}/wuzi/baofeidan/bfxgbmspList.do",
                                dataType:"html",
                                success:function(data){
                                    $('#bfhq').html(data);
                                }
                            });
                        }
                    }
                });
            });

            $('#bfclqrPiSubmit').click(function(){
                $.ajax({
                    type:"POST",
                    data:$('#bfclqrForm').serialize(),
                    url:"${ctx}/wuzi/bfclqrPiSubmit.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容");
                        }else{
                            alert("审批成功！");
                            $.ajax({
                                type:"POST",
                                url:"${ctx}/wuzi/bfclqrList.do",
                                dataType:"html",
                                success:function(data){
                                    $("#bfclqr").html(data);
                                }
                            });
                        }
                    }
                });
            });

            $('#bfclspAll').click(function(){
                if($('#bfclspAll').attr("checked")){
                    $("input[name='bfclspId']:checkbox").prop("checked",true);
                }else{
                    $("input[name='bfclspId']:checkbox").prop("checked",false);
                }
            });

            $('#bfclspPLTY').click(function(){
                $.ajax({
                    type:"POST",
                    url:"${ctx}/wuzi/bfclspPLTY.do",
                    data:$('#bfclspForm').serialize(),
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容！");
                        }else{
                            $.ajax({
                                type:"POST",
                                url:"${ctx}/wuzi/bfclspList.do",
                                dataType:"html",
                                success:function(data){
                                    $("#bfclsp").html(data);
                                }
                            });
                        }
                    }
                });
            });

            $('#bfclspPLBTY').click(function(){
                $.ajax({
                    type:"POST",
                    url:"${ctx}/wuzi/bfclspPL.do",
                    data:$('#bfclspForm').serialize(),
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容！");
                        }else{
                            $('#bfclspForm').attr("action", "${ctx}/wuzi/bfclspPLBTY.do").attr("target","_blank").submit();
                        }
                    }
                });
            });

            $('#fqhqTab').click(function(){
                $.ajax({
                    type:"POST",
                    url:"${ctx}/wuzi/fqhqList.do",
                    dataType:"html",
                    async:false,
                    success:function(data){
                        $("#fqhq").html(data);
                    }
                });
            });

            $('#fqhqAll').click(function(){
                if($('#fqhqAll').attr("checked")){
                    $("input[name='fqhqId']:checkbox").prop("checked",true);
                }else{
                    $("input[name='fqhqId']:checkbox").prop("checked",false);
                }
            });

            $('#fqhqPL').click(function(){
                $.ajax({
                    type:"POST",
                    url:"${ctx}/wuzi/fqhqPL.do",
                    data:$('#fqhqForm').serialize(),
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容！");
                        }else{
                            $('#fqhqForm').attr("action", "${ctx}/wuzi/fqhqPLForm.do").attr("target","_blank").submit();
                        }
                    }
                });
            });

            $('#bfclspTab').click(function(){
                $.ajax({
                    type:"POST",
                    url:"${ctx}/wuzi/bfclspList.do",
                    dataType:"html",
                    async:false,
                    success:function(data){
                        $("#bfclsp").html(data);
                    }
                });
            });

            $('#bmspBHPL').click(function(){
                $.ajax({
                    type:"POST",
                    data:$('#bmbaoFeiForm').serialize(),
                    url:"${ctx}/wuzi/bmbfPL.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容！");
                        }else{
                            $('#bmbaoFeiForm').attr("action", "${ctx}/wuzi/bmbfBHPL.do").attr("target","_blank").submit();
                        }
                    }
                });
            });

            $('#gkbmspBHPL').click(function(){
                $.ajax({
                    type:"POST",
                    data:$('#gkbmbaoFeiForm').serialize(),
                    url:"${ctx}/wuzi/bmbfPL.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容！");
                        }else{
                            $('#gkbmbaoFeiForm').attr("action", "${ctx}/wuzi/bmbfBHPL.do").attr("target","_blank").submit();
                        }
                    }
                });
            });

            $('#gzglyBHPL').click(function(){
                $.ajax({
                    type:"POST",
                    data:$('#gzglybaoFeiForm').serialize(),
                    url:"${ctx}/wuzi/gzglybfPL.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容！");
                        }else{
                            $('#gzglybaoFeiForm').attr("action", "${ctx}/wuzi/gzglybfBHPL.do").attr("target","_blank").submit();
                        }
                    }
                });
            });

            $('#bfhqBHPL').click(function(){
                $.ajax({
                    type:"POST",
                    data:$('#baoFeiHQForm').serialize(),
                    url:"${ctx}/wuzi/bfhqPL.do",
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容！");
                        }else{
                            $('#baoFeiHQForm').attr("action", "${ctx}/wuzi/bfhqBHPL.do?opt=bfxgbmspList").attr("target","_blank").submit();
                        }
                    }
                });
            });

            $('#zgspTab').click(function(){
                $.ajax({
                    type:"POST",
                    url:"${ctx}/wuzi/zgspList.do",
                    dataType:"html",
                    async:false,
                    success:function(data){
                        $("#zgsp").html(data);
                    }
                });
            });

            $('#zgspAll').click(function(){
                if($('#zgspAll').attr("checked")){
                    $("input[name='zgspId']:checkbox").prop("checked",true);
                }else{
                    $("input[name='zgspId']:checkbox").prop("checked",false);
                }
            });

            $('#zgPLTY').click(function(){
                $.ajax({
                    type:"POST",
                    url:"${ctx}/wuzi/zgspPLTY.do",
                    data:$('#zgspForm').serialize(),
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容！");
                        }else{
                            $.ajax({
                                type:"POST",
                                url:"${ctx}/wuzi/zgspList.do",
                                dataType:"html",
                                async:false,
                                success:function(data){
                                    $("#zgsp").html(data);
                                }
                            });
                        }
                    }
                });
            });

            $('#zgPLBTY').click(function(){
                $.ajax({
                    type:"POST",
                    url:"${ctx}/wuzi/zgspPL.do",
                    data:$('#zgspForm').serialize(),
                    dataType:"json",
                    async:false,
                    success:function(data){
                        if(data.result=="none"){
                            alert("未选择审批内容！");
                        }else{
                            $('#zgspForm').attr("action", "${ctx}/wuzi/zgspPLBTY.do").attr("target","_blank").submit();
                        }
                    }
                });
            });



		   <c:if test="${active==2}">
			   	$.ajax({
					type:"POST",
					url:"${ctx}/wuzi/zgspList.do",
					dataType:"html",
					async:false,
					success:function(data){
						$("#zgsp").html(data);
					}
				});
		   </c:if>
		   <c:if test="${active==3}">
			   	$.ajax({
					type:"POST",
					url:"${ctx}/wuzi/fqhqList.do",
					dataType:"html",
					//async:false,
					success:function(data){
						$("#fqhq").html(data);
					}
				});
		   </c:if>
		   <c:if test="${active==4}">
			   	$.ajax({
					type:"POST",
					url:"${ctx}/wuzi/bfhqList.do",
					dataType:"html",
					async:false,
					success:function(data){
						$("#bfhq").html(data);
					}
				});
		   </c:if>
		   <c:if test="${active==5}">
			   	$.ajax({
					type:"POST",
					url:"${ctx}/wuzi/bmspList.do",
					dataType:"html",
					async:false,
					success:function(data){
						$("#bmsp").html(data);
					}
				});
		   </c:if>
		   <c:if test="${active==6}">
			   	$.ajax({
					type:"POST",
					url:"${ctx}/wuzi/gzglyspList.do",
					dataType:"html",
					async:false,
					success:function(data){
						$("#gzglysp").html(data);
					}
				});
		   </c:if>
		   <c:if test="${active==8}">
			   	$.ajax({
					type:"POST",
					url:"${ctx}/wuzi/bfclspList.do",
					dataType:"html",
					async:false,
					success:function(data){
						$("#bfclsp").html(data);
					}
				});
		   </c:if>
		   <c:if test="${active==10}">
			   	$.ajax({
					type:"POST",
					url:"${ctx}/wuzi/bfclqrList.do",
					dataType:"html",
					async:false,
					success:function(data){
						$("#bfclqr").html(data);
					}
				});
		   </c:if>

			setActiveTab();
		});

        function setActiveTab() {
            var activeTab = $('.nav-tabs').find('li:first');
            activeTab.find('a').trigger('click');
            activeTab.addClass('active');
        }

		var baoFeiHuiQian=function(id){
			$.ajax({
				type:"GET",
				url:"${ctx}/wuzi/baoFeiShenPiLZ.do?id="+id,
				dataType:"json",
				async:false,
				success:function(data){
					if(data.result=="success"){
						alert('您同意物资报废！');
						$.ajax({
							type:"POST",
							url:"${ctx}/wuzi/bfhqList.do",
							dataType:"html",
							success:function(data){
								$('#bfhq').html(data);
							}
						});
					}
				}
			});
		}
		
		var baoFeiSP=function(id){
			$.ajax({
				type:"GET",
				url:"${ctx}/wuzi/baoFeiSP.do?id="+id,
				dataType:"json",
				async:false,
				success:function(data){
					if(data.result=="success"){
						alert('您同意物资报废并入库！');
						$.ajax({
							type:"POST",
							url:"${ctx}/wuzi/gzglyspList.do",
							dataType:"html",
							success:function(data){
								$("#gzglysp").html(data);
							}
						});
					}
				}
			});
		}
		

		

		
		function baoFeiRZ(id, huanJieId){
		    $.ajax({
                type:"POST",
                url:"${ctx}/wuzi/bfclrzSave.do",
                data:{
                    "id":id
                },
                dataType:"json",
                async:false,
                success:function(data){
                    if(data.result=="success"){
                        alert("请您将物资报废入账");
                        $.ajax({
                            type:"POST",
                            url:"${ctx}/wuzi/bfclrzList.do",
                            dataType:"html",
                            success:function(data){
                                $("#bfclrz").html(data);
                            }
                        });
                    }
                }
            });
		}
		
		function bfclQueRen(id){			
			$.ajax({
				type:"POST",
				url:"${ctx}/wuzi/bfclqrSave.do",
				data:{
					"id":id
				},
				dataType:"json",
				async:false,
				success:function(data){					
					if(data.result=="success"){
						alert("报废处理已完成");
						$.ajax({
							type:"POST",
							url:"${ctx}/wuzi/bfclqrList.do",
							dataType:"html",
							success:function(data){
								$('#bfclqr').html(data);
							}
						});
					}
				}
			});			
		}

		

		
		var LODOP=getLodop(document.getElementById('LODOP_OB'),document.getElementById('LODOP_EM'));		
		
		var iRadioValue2=1;
		function PreviewMytable2(){
			LODOP=getLodop();  
			LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_预览打印表格");
			LODOP.ADD_PRINT_TABLE("10mm","10mm","190mm","50mm",document.getElementById("div3").innerHTML);
	    	LODOP.ADD_PRINT_TABLE("25mm","10mm","190mm","100mm",document.getElementById("div4").innerHTML);
			LODOP.SET_PRINT_STYLEA(0,"TableHeightScope",iRadioValue2);
			LODOP.PREVIEW();
		};
		function check(thisValue){
		  iRadioValue2=thisValue;
		}
		var neiGouDan=function(id){			
			$.ajax({
				type:"POST",
				data:{
					"id":id
				},
				url:"${ctx}/wuzi/baoFeiChuLiDan.do",
				dataType:"json",
				success:function(data){
					$('#cLdanJuRQ').html(data.cLdanJuRQ);
					$('#cLziChanBH').html(data.cLziChanBH);
					$('#cLziChanBM').html(data.cLziChanBM);
					$('#cLwuZiMC').html(data.cLwuZiMC);
					$('#cLgouMaiRQ').html(data.cLgouMaiRQ);
					$('#cLkaiShiJiTiRQ').html(data.cLkaiShiJiTiRQ);
					$('#cLwuZiYZ').html(data.cLwuZiYZ);
					$('#cLwuZiJingZhi').html(data.cLwuZiJingZhi);
					$('#cLleiJiZheJiuJE').html(data.cLleiJiZheJiuJE);
					$('#cLzheJiuYX').html(data.cLzheJiuYX);
					$('#cLyiZheJiuYS').html(data.cLyiZheJiuYS);					
					$('#cLshiYongBM').html(data.cLshiYongBM);
					$('#cLshiYongR').html(data.cLshiYongR);
					$('#cLchuLiFS').html(data.cLchuLiFS);
					$('#cLhuiShouDW').html(data.cLhuiShouDW);					
					$('#cLhuiShouJE').html(data.cLhuiShouJE);
					$('#cLcaiWuQRR').html(data.cLcaiWuQRR);
					PreviewMytable2();
				}
			});
		}
		
		var baoFeiNeiGou=function(id){
			$.ajax({
				type:"POST",
				data:{
					"id":id
				},
				url:"${ctx}/wuzi/baoFeiNeiGou.do",
				dataType:"json",
				async:false,
				success:function(data){
					$.ajax({
						type:"POST",
						url:"${ctx}/wuzi/bfngList.do",
						dataType:"html",
						success:function(data){
							$('#bfng').html(data);
						}
					});
				}
			});
		}
		

		
		function daYin(id){
			LODOP=getLodop();  
			LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_预览打印表格");
			LODOP. SET_PRINT_PAGESIZE (2, 0, 0,"A4");
			$.ajax({
				type:"POST",
				data:{
					"id":id
				},
				url:"${ctx}/wuzi/baoFeiDaYinHTML.do",
				dataType:"html",
				async:false,
				success:function(data){
					LODOP.ADD_PRINT_HTM("10mm","30mm","250mm","400mm",data);
					LODOP.PREVIEW();
				}
			});
		}
		

		
		function zhuGuanTY(id){
			$.ajax({
				type:"POST",
				url:"${ctx}/wuzi/zgspTY.do",
				data:{
					"id":id
				},
				dataType:"json",
				async:false,
				success:function(data){
					alert("审批成功!");
					$.ajax({
						type:"POST",
						url:"${ctx}/wuzi/zgspList.do",
						dataType:"html",
						async:false,
						success:function(data){
							$("#zgsp").html(data);
						}
					});
				}
			});
		}
		
		function chuLiSPTY(id){
			$.ajax({
				type:"POST",
				url:"${ctx}/wuzi/bfclspTY.do",
				data:{
					"id":id
				},
				dataType:"json",
				async:false,
				success:function(data){
					alert("审批成功！");
					$.ajax({
						type:"POST",
						url:"${ctx}/wuzi/bfclspList.do",
						dataType:"html",
						success:function(data){
							$("#bfclsp").html(data);
						}
					});
				}
			});
		}
        function bfzjlsptySave(id){
            $.ajax({
                type:"GET",
                url:"${ctx}/wuzi/baofeidan/bfzjlsptySave.do?id="+id,
                dataType:"json",
                success:function(data){
                    if(data.result=="success"){
                        alert('您同意物资报废！');
                        $.ajax({
                            type:"POST",
                            url:"${ctx}/wuzi/baofeidan/bfzjlspList.do",
                            dataType:"html",
                            success:function(data){
                                $('#bfhq').html(data);
                            }
                        });
                    }
                }
            });
        }
	</script>
	<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>